﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;

namespace IHISCETeim.Web.MachineSys.JSDWF
{
    public partial class JSDWFFlowConfigAdd : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.新增 };
            }
        }
        protected override string DWZRef
        {
            get { return "JSDWFFlowConfigList"; }
        }
        protected int AdtlvlID
        {
            get
            {
                return GetRequestValue<int>("AdtlvlID", 0);

            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (AdtlvlID == 0)
            {
                Response.Write("请先选择一个图纸级别.");
                Response.End();
            }
            if (GetRequestValue<string>("ajaxmethod", "") == "add")
            {
                addmenu();
            }
        }
        private void addmenu()
        {
            JSDWFFlowConfigInfo obj = Request.SerializableObject<JSDWFFlowConfigInfo>();
            
            
            AddLog(Permission.新增, obj);

            obj.UserName = GetRequestValue<string>("dwz.orgLookup.UserName","");

            int r=JSDWFFlowConfigController.Add(obj);

            if (r > 0)
                SuccessJson("添加成功");
            else
            {
                ErrorJson("添加失败,审批顺序 不能重复");
            }
        }

    }
}